package com.app.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 转盘活动
 * </p>
 *
 * @author yoominic
 * @since 2023-12-16
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("lm_activity")
public class PrizeActivity implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 活动名称
     */
    private String name;

    /**
     * 开始时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private String startTime;

    /**
     * 结束时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private String endTime;

    /**
     * 描述
     */
    private String description;

    /**
     * 单人当天限制次数 0代表不限次
     */
    private Integer dayLimit;

    @TableField(exist = false)
    private Integer userTodayCount;

    /**
     * 活动状态 1开启2关闭
     */
    private Integer status;
    /**
     * 免费次数
     */
    private Integer freeFrequency;
    /**
     * 消费券
     */
    private Integer consumptionVoucher;
    /**
     * 消费积分
     */
    private Integer consumptionPoints;


    private LocalDateTime createTime;

    private LocalDateTime updateTime;

    @TableField(exist = false)
    private List<Prize> prizeList;

    @TableField(exist = false)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long prizeId;

    @TableField(exist = false)
    private List<LotteryRecord> lotteryRecords;
}
